<template>
    <div class="haha">
        <van-loading type="spinner" size="40"/>
    </div>
</template>
<script>
    import {getUserStatus} from "../api"
    export default {
        created (){
            var appId = "cs_dtccm";
            // 发起请求（获取accessToken）
            this.$token(appId)
        },
        methods: {
            //查询用户信息接口
            getUser(data){
                getUserStatus(data)
                .then((res)=>{
                    console.log(res);
                    if( res.data.respCode === "0000" ){
                        if(res.data.data.status==1){
                            localStorage.setItem("user_id",res.data.data.user_id)
                            localStorage.setItem("idnumber",res.data.data.idcard_no)
                            localStorage.setItem("mobile_phone",res.data.data.mobile_phone)
                            localStorage.setItem("name",res.data.data.name)
                            localStorage.setItem("bankCard",res.data.data.bankCard)
                            this.$router.push("/busword")
                        }else{
                            localStorage.setItem("user_id",res.data.data.user_id)
                            localStorage.setItem("idnumber",res.data.data.idcard_no)
                            localStorage.setItem("mobile_phone",res.data.data.mobile_phone)
                            localStorage.setItem("name",res.data.data.name)
                            localStorage.setItem("bankCard",res.data.data.bankCard)
                            localStorage.setItem("add",1)
                            this.$router.push("/busword")
                        }
                    }else if(res.data.respCode == 6000){
                        localStorage.setItem("user_id",res.data.data.user_id)
                        localStorage.setItem("idnumber",res.data.data.idcard_no)
                        localStorage.setItem("mobile_phone",res.data.data.mobile_phone)
                        localStorage.setItem("name",res.data.data.name)
                        localStorage.setItem("bankCard",res.data.data.bankCard)
                        // this.$router.push("/home")
                        this.$router.push("/wallet")
                    }else if(res.data.respCode == 6001){
                        localStorage.setItem("user_id",res.data.data.user_id)
                        localStorage.setItem("idnumber",res.data.data.idcard_no)
                        localStorage.setItem("mobile_phone",res.data.data.mobile_phone)
                        localStorage.setItem("name",res.data.data.name)
                        localStorage.setItem("bankCard",res.data.data.bankCard)
                        this.$router.push("/home")
                    }
                })
            },
        }
    }
</script>
<style lang="scss" scoped>
    .haha{
        width: 100%;
        height: 100%;
        background-color:#0064F4;
        display: flex;
        justify-content: center;
        align-items: center;
    }
</style>